<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\BuyNews
 *
 * @property int $id
 * @property int $uid
 * @property string|null $title
 * @property string|null $nickname
 * @property string|null $phone
 * @property string|null $province
 * @property string|null $city
 * @property string|null $district
 * @property string|null $street
 * @property string|null $description
 * @property int $views
 * @property mixed $created_at
 * @property mixed $updated_at
 * @property-read \App\Models\User $user
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereCity($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereDescription($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereDistrict($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereNickname($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews wherePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereProvince($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereStreet($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereUid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BuyNews whereViews($value)
 * @mixin \Eloquent
 */
class BuyNews extends Model
{
    protected $table = 'buy_news';
    protected $primaryKey = 'id';
    protected $guarded = [];
    protected $dateFormat = 'U';
    protected $casts = [
        'created_at'=>'datetime:Y-m-d H:i:s',
        'updated_at'=>'datetime:Y-m-d H:i:s',
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo(User::class, 'uid', 'uid');
    }
}
